
class Piece:
    """" Stores information about a piece """
    
    def __init__(self, type, square):
        self.type = type
        self.square = square
        
        
class BallPiece(Piece):
    """ Stores information about a ball """
    
    def __init__(self, square):
        Piece.__init__(self, "Ball", square)
        
    def __str__(self):
        return str(self.square.row) + ' ' + str(self.square.col)
        
        
class PlayerPiece(Piece):
    """ Stores information about a player """
    
    (G, L, P, N, R) = range(5)
    
    def __init__(self, id, square=None):
        Piece.__init__(self, "Player", square)
        self.id = id
        self.orientation = None
        
    
    def __str__(self):
        return ('Id: ' + str(self.id) + ' Orientation: ' + str(self.orientation)
                + ' Square: ' + str(self.square))
        
    
    def __eq__(self, player):
        return self.id == player.id and self.orientation == player.orientation
            
    def __ne__(self, piece):
        return not self.__eq__(self, player)